

// store/index.js

import {legacy_createStore, applyMiddleware, compose} from 'redux'

import { thunk } from 'redux-thunk'


import reducer from './reducer.js'

// composeEnhancers 函数
// const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({trace: true}) || compose

const storeEnhancer = applyMiddleware(thunk)
const store = legacy_createStore(reducer, composeEnhancers(storeEnhancer))

export default store